import React from 'react';
import { Tabs } from 'antd';

const { TabPane } = Tabs;

const CustomTabs = ({ TabPaneList, activeTabKey, onChange }) => {
  console.log(activeTabKey, 'activeTabKey');
  const handleTabChange = key => {
    onChange(key);
  };

  return (
    <Tabs activeKey={activeTabKey} onChange={handleTabChange}>
      {TabPaneList.map(item => {
        return <TabPane tab={item.tab} key={item.key}></TabPane>;
      })}
    </Tabs>
  );
};

export default CustomTabs;
